#include "Timer_0.h"

/* *****************************************
 * 2022年4月8日
 * 吴昕灿
 * 51单片机
 * 定时器0中断
 * 16位计数器（不分频）115200HZ
 * ****************************************/



void Timer_0_Servo_Com(u16 speed) //定时器零初始化
{


    TIM_InitTypeDef timer_0_com;

    timer_0_com.TIM_Mode = TIM_16Bit; //16位计数器 
    timer_0_com.TIM_Polity = PolityLow; //中断优先级低
    timer_0_com.TIM_Interrupt = ENABLE;//使能中断
    timer_0_com.TIM_ClkSource = TIM_CLOCK_1T;//时钟来源系统时钟(分频为1)
    timer_0_com.TIM_ClkOut = DISABLE;   //可编程时钟输出关闭
    timer_0_com.TIM_Value = speed;      //定时时间
    timer_0_com.TIM_Run = DISABLE;    //定时器零关闭
    
    Timer_Inilize(Timer0,&timer_0_com); //初始化
}




